//
//  UIBarButtonItem+GYMExtension.m
//  项目-百思不得姐
//
//  Created by 苟亚明 on 16/7/21.
//  Copyright © 2016年 苟亚明. All rights reserved.
//

#import "UIBarButtonItem+GYMExtension.h"

@implementation UIBarButtonItem (GYMExtension)

+ (instancetype)itemWithImage:(NSString *)image highImage:(NSString *)highImage target:(id)tatget action:(SEL)action{
    UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
    [btn setBackgroundImage:[UIImage imageNamed:image] forState:UIControlStateNormal];
    [btn setBackgroundImage:[UIImage imageNamed:highImage] forState:UIControlStateHighlighted];
    btn.size = btn.currentBackgroundImage.size;
    [btn addTarget:tatget action:action forControlEvents:UIControlEventTouchUpInside];
    
    return [[self alloc]initWithCustomView:btn];
}
@end
